import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import 'dayjs/locale/zh-cn';
import locale from 'element-plus/es/locale/lang/zh-cn';
import * as echarts from 'echarts';
import { timestamp, get , post , setCookie , getCookie , delCookie , imgBase , imgCompress,} from './api/axios'

// main.js 或 app.js
if (process.env.NODE_ENV === 'production') {
    console.log = () => {};
    console.info = () => {};
    console.error = () => {};
    console.warn = () => {};
    console.debug = () => {};
    console.table = () => {};
    console.time = () => {};
    console.timeEnd = () => {};
    console.trace = () => {};
    console.dir = () => {};
    console.dirxml = () => {};
    console.group = () => {};
    console.groupCollapsed = () => {};
    console.groupEnd = () => {};
    console.assert = () => {};
    console.count = () => {};
    console.clear = () => {};
    console.profile = () => {};
    console.profileEnd = () => {};
    console.timeLog = () => {};
    console.memory = () => {};
    console.scope = () => {};
}
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.config.globalProperties.timestamp = timestamp;
app.config.globalProperties.get = get;
app.config.globalProperties.post = post;
app.config.globalProperties.setCookie = setCookie;
app.config.globalProperties.getCookie = getCookie;
app.config.globalProperties.delCookie = delCookie;
app.config.globalProperties.delCookie = imgBase;
app.config.globalProperties.delCookie = imgCompress;
app.config.globalProperties.$echarts = echarts;
app.use(ElementPlus,{locale})
app.use(store).use(router).mount('#app')